home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / Apr 90 / MacApp.Tech$ 4⁄13⁄90 / 1070-Re[2] C++ use of Cat-Apr90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.2 KB  |  34 lines  |  [TEXT/GEOL]

  1. Item    0462746                         10-April-90        09:46PDT
  2.  
  3. From:   ALGER                           Alger, Jeff,VCA
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.  
  7. Sub:    Re: RE>C++ use of Catchfailur
  8.  
  9. Wouldn't the world of failure handling be a LOT simpler if the "fi" argument to
  10. CatchFailures were made an object, whose methods could be overridden?  The
  11. interface could look something like this:
  12.  
  13. TFailInfo = OBJECT (TObject)
  14.   fFi: FailInfo; { although I would rather see this broken out! }
  15.   PROCEDURE TFailInfo.CatchFailures;
  16.   PROCEDURE TFailInfo.Success;
  17.   PROCEDURE TFailInfo.Recover;
  18. END;
  19.  
  20. A subclass which overrode CatchFailures would do its thing to remember state,
  21. then call INHERITED.  Similarly, linkage between subclass and superclass could
  22. easily be set up for the other methods.  This interface would allow C++ failure
  23. handling to operate the same way as Object Pascal failure handling.  It would
  24. also be a lot easier to teach people.  An interesting sidenote: the constructor
  25. in C++ could automatically call CatchFailures and the destructor Success.
  26. Thus, instantiation and registration could be combined into a single step.
  27.  
  28. Food for thought.
  29.  
  30. Jeff Alger
  31. Exis
  32. A Technology Firm of KPMG Peat Marwick
  33.  
  34.